package com.meihua.baoleyi.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.meihua.baoleyi.R;


/**
 * Created by liming on 2017/10/18
 * desc:
 */

public class BaseNoDateAdaper extends RecyclerView.Adapter<BaseNoDateAdaper.baseHOlder> {

    public BaseNoDateAdaper(Context context, int show) {
        this.context = context;
        this.show = show;
    }

    private Context context;
    private int show;

    @Override
    public baseHOlder onCreateViewHolder(ViewGroup parent, int viewType) {
        baseHOlder holder = new baseHOlder(LayoutInflater.from(context).inflate(R.layout.view_no_wifi_or_nodate,parent,false));
        return holder;
    }

    @Override
    public void onBindViewHolder(baseHOlder holder, int position) {
        if (show !=1){
            holder.iv.setImageResource(R.drawable.nowifi);
        }else {
            holder.iv.setImageResource(R.drawable.empty_view);
        }

    }

    @Override
    public int getItemCount() {
        return 1;
    }


    class baseHOlder extends RecyclerView.ViewHolder {
        ImageView iv;

        public baseHOlder(View view) {
            super(view);
            iv = view.findViewById(R.id.img);
        }

    }
}
